/**
 * 
 */
package niuke.shenxinfu;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 字符串数组排序 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		scanner.nextLine();
		String[] strings = new String[n];
		for (int i = 0; i < n; i++) {
			strings[i] = scanner.nextLine();
		}
		scanner.close();
		Arrays.sort(strings);
		for (String string : strings) {
			System.out.println(string);
		}
	}

}
